package router

import (
	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
	"mxshop_api/order-web/api/order"
	"mxshop_api/order-web/api/pay"
	"mxshop_api/order-web/middlewares"
)

func InitOrderRouter(Router *gin.RouterGroup) {
	OrderRouter := Router.Group("/orders").Use(middlewares.JWTAuth())
	// 添加健康检查路由

	zap.S().Infof("配置用户路由")
	{
		OrderRouter.GET("", order.List)        //获取订单列表
		OrderRouter.POST("", order.New)        // 新建订单
		OrderRouter.GET("/:id/", order.Detail) // 获取订单详情
	}
	payRouter := Router.Group("/pay")
	{
		payRouter.POST("/alipay/notify", pay.Notify)
	}
}
